package Aplicacion;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class Interfaz_grafica extends JPanel {

	private JButton botones [];
	private JPanel panel_2;
	private Graphics mis_graficos;
	
	public Interfaz_grafica(Graphics g)	 {
		this.mis_graficos = g;
		super.paint(mis_graficos);
		inicializarComponentes();
	}
	
		public void inicializarComponentes()	{
			
			this.setBackground(Color.white);
			this.setLayout(null);
			
			JLabel label = new JLabel("Añadir Usuario");
			label.setFont(new Font("Ubuntu",Font.PLAIN,40));
			label.setBounds(25,5,400,100);
			this.add(label);
			
			JSplitPane splitPane = new JSplitPane();
			splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
			splitPane.setBounds(48, 100, 229, 300);
			splitPane.setDividerLocation(250);
			this.add(splitPane);
				
			JPanel panel_1 = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 20));
			panel_1.setBackground(Color.white);
			splitPane.setLeftComponent(panel_1);
		
		    panel_2 = new JPanel();
			panel_2.setBackground(Color.white);
			splitPane.setRightComponent(panel_2);
			
			botones = new JButton[5];
			
			for (int i = 0; i < botones.length; i++) 	{
				botones[i] = new JButton("Jugador "+(i+1));
//				botones[i].addActionListener(this);
				botones[i].setFont(new Font("Ubuntu",Font.PLAIN,15));
				panel_1.add(botones[i]);
			}
		}
		
		public Graphics getGraphics(){
			System.err.println(super.getGraphics());
			return super.getGraphics();
		}
	}

	
